<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>模板字面量-原始字符串</title>
    </head>
    <body>
        <h1>模板字面量-原始字符串</h1>
        <p>来源:<a href="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/template_strings">https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/template_strings</a></p>
        <h3>原始字符串</h3>
        <script>
            // function tag(strings) {
            //   console.log(strings.raw[0]);
            // }

            // tag`string text line 1 \n string text line 2`;
            var str = String.raw`Hi\n${2+3}!`;
            // "Hi\n5!"
            str.length;
            // 6

            str.split('').join(',');
            // "H,i,\,n,5,!"
        </script>
    </body>
</html>